/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package it.trick.admin.controller;

import it.trick.admin.App;
import it.trick.admin.model.ContentsBaseModel;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.AnchorPane;

/**
 * FXML Controller class
 *
 * @author takahara
 */
public class DeleteContentsViewController extends AnchorPane implements Initializable {
    @FXML
    private Label nameLabel;
    @FXML
    public Button deleteButton;

    private String name;

    /**
     * コンストラクタ
     */
    public DeleteContentsViewController(String name) {
        this.name = name;
        initFxml();
    }

    /**
     * FXMLの初期化
     */
    private void initFxml() {
        // ---------------------------------------------------
        // FXMLのロードと設定
        // ---------------------------------------------------
        FXMLLoader fxmlLoader = new FXMLLoader(App.class.getResource("resource/fxml/delete_contents_view.fxml"));
        fxmlLoader.setRoot(this);
        // 自分自身をコントロールとして設定
        fxmlLoader.setController(this);

        try {
            fxmlLoader.load();
        } catch (IOException exception) {
            throw new RuntimeException(exception);
        }
    }

    /**
     * Initializes the controller class.
     */
    @Override
    public void initialize(URL url, ResourceBundle rb) {
        nameLabel.setText(name);
    }

    @FXML
    protected void cancelAction() {
        App.getInstance().closePopStage();
    }
}
